<?php

/**
 * @author Barkowsky Igor
 * @copyright 2008
 * @filesource index.php
 * @subpackage news admin
 */
$per_page = 5;
$lim_from = $from*$per_page;
$table=PFX."articles";
$items = $db->fetch_array("SELECT SQL_CALC_FOUND_ROWS * FROM $table ORDER BY time DESC LIMIT $lim_from,$per_page");
if($items!=false)
{
	$quantity = $db->fetch_one(QUANTITY);
	$per_page_navigation = ceil($quantity[0]/$per_page);
	if($quantity[0]>0)
	{
		foreach($items as $k=>$v)
		{
			if($v['image']=='1')
				$items[$k]['photo']=UPLOAD.$page['dir']."/".$v['id'];
			else $items[$k]['photo']=false;
		}
		$smarty->assign("kolvo",$quantity[0]);
		$smarty->assign("items",$items);
		$smarty->assign("ppn",$per_page_navigation);
	}
}
?>